#include<iostream>
#include<cmath>
#include<string>
using namespace std;
class Hotel
{
private:
    static int totalCustNum; // 顾客总人数
    static float totalEarning; // 旅店总收入
    static float rent; // 每个顾客的房租
    string customerName; // 顾客姓名
    int customerId; // 顾客编号
public:
    // totalCustNum++，customerId按照totalCustNum生成
    Hotel(string customer):customerName(customer)
    {
        ++totalCustNum;
        totalEarning+=rent;
    }
    ~Hotel(){}
    void Display()
    {
        cout<<customerName<<" 2015";
        printf("%04d ",totalCustNum);
        cout<<totalCustNum<<" "<<totalEarning<<endl;
    }
    static float setRent(float aa)
    {
        rent=aa;
    }
};
int Hotel::totalCustNum=0;
float Hotel::totalEarning=0;
float Hotel::rent=0;
int main()
{
    float tmp_rent;
    cin>>tmp_rent;
    Hotel::setRent(tmp_rent);
    string name;
    cin>>name;
    while(name!="0")
    {
        Hotel ans(name);
        ans.Display();
        cin>>name;
    }
}